package com.atguigu.lease.config;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 51560
 * @project lease
 * @title MybatisPlus配置类
 * @package com.atguigu.lease.common.mybatisplus
 * @since 2025/5/5 15:27
 */
@Configuration
@MapperScan("com.atguigu.lease.web.mapper")
public class MybatisPlusConfiguration {

    // mybatis-plus 分页插件
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor() {
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        interceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        return interceptor;
    }

}
